Imports System.Web

Public Class Rpt_Indexes
    Private Const Q As String = Chr(34)

    Public Sub ShowIndexDetail( _
                     ByVal lTableID As Long, _
                     ByVal lRevID As Long)

        Dim oFactory As New SQLAutoDocLib.Index_Factory

        HttpContext.Current.Response.Write("<table style=" & Q & "text-align: center; margin-top: 15px;" & Q & _
                                                 " class=" & Q & "wmObjectDetail_T" & Q & ">")

        HttpContext.Current.Response.Write("<tr class=" & Q & "wmObjectDetail_TH" & Q & ">")
        HttpContext.Current.Response.Write("<td style=" & Q & "text-align: center; margin-top: 15px;" & Q & _
                                              " class=" & Q & "wmIndexList_ZH" & Q & ">")
        HttpContext.Current.Response.Write("Indexes")
        HttpContext.Current.Response.Write("</td>")
        HttpContext.Current.Response.Write("</tr>")

        Dim bAlternatingRow As Boolean = False

        For Each oField As SQLAutoDocLib.Index In oFactory.GetAllIndexesForTable(lTableID, lRevID)
            With oField
                If bAlternatingRow = False Then
                    HttpContext.Current.Response.Write("<tr class=" & Q & "wmObjectDetail_T" & Q & ">")
                Else
                    HttpContext.Current.Response.Write("<tr class=" & Q & "wmObjectDetail_TA" & Q & ">")
                End If

                HttpContext.Current.Response.Write("<td class=" & Q & "wmIndexList_ZN" & Q & ">" & .Name & "</td>")
                HttpContext.Current.Response.Write("</tr>")

                If bAlternatingRow = False Then
                    HttpContext.Current.Response.Write("<tr class=" & Q & "wmObjectDetail_T" & Q & ">")
                Else
                    HttpContext.Current.Response.Write("<tr class=" & Q & "wmObjectDetail_TA" & Q & ">")
                End If
                HttpContext.Current.Response.Write("<td class=" & Q & "wmIndexList_ZD" & Q & ">" & .Index_Desc & "</td>")
                HttpContext.Current.Response.Write("</tr>")

                If bAlternatingRow = False Then
                    HttpContext.Current.Response.Write("<tr class=" & Q & "wmObjectDetail_T" & Q & ">")
                Else
                    HttpContext.Current.Response.Write("<tr class=" & Q & "wmObjectDetail_TA" & Q & ">")
                End If
                HttpContext.Current.Response.Write("<td class=" & Q & "wmIndexList_ZK" & Q & ">" & .Keys & "</td>")
                HttpContext.Current.Response.Write("</tr>")
            End With

            bAlternatingRow = Not bAlternatingRow
        Next
        HttpContext.Current.Response.Write("</table>")
    End Sub

End Class
